package org.example.userservice.openfeign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;


@FeignClient(name = "permission-service", path = "/permission")
public interface PermissionClient {

    // 绑定默认角色
    @PostMapping("/binddefaultrole/{userId}")
    void bindDefaultRole(@PathVariable("userId") Long userId);

    // 查询角色代码
    @GetMapping("/getrolecode/{userId}")
    String getUserRoleCode(@PathVariable("userId") Long userId);

    // 提升为管理员
    @PostMapping("/uplevel/{userId}")
    void uplevelToAdmin(@PathVariable("userId") Long userId);

    // 降级为普通用户
    @PostMapping("/downlevel/{userId}")
    void downlevelToUser(@PathVariable("userId") Long userId);

    //获取普通用户ID
    @GetMapping("/getnormaluser")
    List<Long> getNormalUser();

}
